package com.xnyzc.lhy.common.penum.pay;

public enum EPayType {
    alipay(0, "支付宝"),
    weChat(1, "微信"),
    balance(2, "其它");



    private Integer type;
    private String value;

    EPayType(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    public static EPayType findById(Integer type) {
        EPayType ePaymentType;
        switch (type) {
            case 0:
                ePaymentType = EPayType.alipay;
                break;
            case 1:
                ePaymentType = EPayType.weChat;
                break;
            case 2:
                ePaymentType = EPayType.balance;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return ePaymentType;
    }

    public String getValue() {
        return this.value;
    }

    public Integer getType() {
        return this.type;
    }
}
